<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "v1" middleware group. Now create something great!
| 一片烟花一片红
| - - - - - - -
| 佳节岂是伤心事
| 此去归来又一年
*/

/**
 * banner图
 */
//Route::group(['prefix' => 'common', 'namespace' => 'Common'], function(){
//    Route::apiResource("");
//});
Route::get("/", "TestController@index");

/**
 * 用户
 */
Route::group(['prefix' => 'users', 'namespace' => 'User'], function(){
    Route::post("registeries", "Author2Controller@register")->name("users.register");
    Route::post("logins", "Author2Controller@login")->name("users.login");
    Route::get("authories2", 'Author2Controller@auth')->name("users.auth");
    Route::post("addinfos", 'Author2Controller@addInfo')->name("users.addinfo");
    Route::post("upload/headimg", "Author2Controller@uploadheadimg")->name("user.uploadheadimg");
    Route::get( "authies/uid/{uid}", "QualificationController@authies", function($uid){} )->name( "user.authies" )->where(['uid'=>'\d+']);
    Route::post( "addauth", "QualificationController@addauth" )->name( "user.addauth" );
});

/**
 * 主要模块,走失人相关
 */
Route::group(['prefix' => 'seeks', 'namespace' => 'Seek'], function(){
   Route::post("seekpost", "SeekController@post")->name("seeks.post");
   Route::get( "isPost/uid/{uid}", "SeekController@isPost", function($uid){} )->name("seeks.isPost")->where("uid", "\d+");
   Route::get( "newlists", "SeekController@newlists")->name("seeks.newlists");
   Route::get( "searchnotice", "SeekController@searchnotice")->name("seeks.searchnotice");
   Route::get( "detail/id/{id}", "SeekController@detail", function($id){} )->name("seeks.detail")->where(['id'=>'\d+']);
});

/**
 * 系统
 */
Route::group(['prefix' => 'system', 'namespace' => 'System'], function(){
    Route::get("messagelist", "MessageController@list")->name("system.messagelist");
    Route::get("messagedetail/id/{id}", "MessageController@detail", function($id){})->name("system.messagedetail")->where(['id'=>'\d+']);
    Route::get("messagesign/uid/{uid}", "MessageController@sign", function($uid){})->name("system.messagesign")->where(['uid'=>'\d+']);
    Route::get("noticelist", "NoticeController@noticelist")->name("system.noticelist");
});

/**
 * 公用
 */
Route::group(['prefix' => 'common', 'namespace' => 'Common'], function(){
   Route::get("map/getpca/pid/{pid}", "MapController@getpca", function($pid){})->name("common.getpca")->where(['pid'=>'\d+']);
   Route::get("map/getaddressname", "MapController@getaddressname")->name("common.getaddressname");
   Route::get("qiniu/gettoken", "QiniuController@gettoken")->name("common.gettoken");
});

/**
 * 走失人相关路由
 */
Route::group(['namespace' => 'Seeks'], function(){
   Route::apiResource("seeks", "SeeksController");
});